home *** CD-ROM | disk | FTP | other *** search
Text File | 1989-06-16 | 4.0 KB | 165 lines | [TEXT/MPS ] |
-
- Procedure DoAddrErr; external;
- Procedure DoillErr; external;
- Procedure DoPrivErr; external;
- Procedure DoTraceErr; external;
- Procedure DoFTrap; external;
- Procedure GetResPatch; external;
- procedure DoPack1; external;
-
-
- Procedure InstallPatch ( pack: Integer );
- var l: LongPtr;
-
- begin
- l := LongPtr ( $AB8 + ( pack * 4 ));
- l^ := 0;
- l := LongPtr ( $A78 );
- l^ := GetTrapAddress ( $A9A0 );
- SetTrapAddress ( LongInt ( @GetResPatch ), $A9A0 );
- end;
-
- Procedure RemovePatch;
- var l: LongPtr;
- begin
- l := LongPtr ( $A78 );
- SetTrapAddress ( l^, $A9A0 );
- end;
-
- Procedure StkOverFlow;
- var bigJunk: array [ 0 .. 30000 ] of Integer;
- l: LongInt;
-
- begin
- Delay ( 2, l );
- StkOverFlow;
- end;
-
- Procedure DoSystemError ( sysError: Integer );
- type
- IntPtr=^Integer;
- var
- i, j, k: Integer;
- l, m: Size;
- ip:IntPtr;
- anArray:array [0..1] of integer;
- h: Handle;
- tz: THz;
- lh:ListHandle;
- x,y,z:extended;
- where:Point;
- reply:SFReply;
- aTypeList:SFTypeList;
-
- begin
- case sysError of
- 1: { Bus Error }
- begin
- ip:=IntPtr(-1);
- i:=ip^;
- end;
- 2: DoAddrErr; { Address Error }
- 3: DoillErr; { Illegal Instuction Error }
- 4: j := i div 0; { Divide by zero Error }
- 5: { Check Trap Error }
- begin
- j := 32767;
- i:=anArray[j];
- end;
- 6: ; { Overflow Trap Error }
- 7: DoPrivErr; { Privilege violation Error }
- 8: DoTraceErr; { Trace Mode Error }
- 9: ; { line 1010 trap Error }
- 10: DoFTrap; { line 1111 trap Error }
- 11: ; { misc hardware exception Error }
- 12: ; { Unimplemented core routine Error }
- 13: ; { Uninstalled interrupt Error }
- 14: ; { I/O Core Error }
- 15: ; { Segment Loader Error }
- 16: ; { Floating Point Error }
- (*
- listMgr = 0; {list manager}
- dskInit = 2; {Disk Initializaton}
- stdFile = 3; {Standard File}
- flPoint = 4; {Floating-Point Arithmetic}
- trFunc = 5; {Transcendental Functions}
- intUtil = 6; {International Utilities}
- bdConv = 7; {Binary/Decimal Conversion}
- *)
- 17: begin { Package 0 Not Present }
- InstallPatch ( 0 );
- LDispose(lh);
- RemovePatch;
- end;
- 18: begin { Package 1 Not Present }
- InstallPatch ( 1 ) ;
- DoPack1;
- RemovePatch;
- end;
- 19: begin { Package 2 Not Present }
- InstallPatch ( 2 );
- Debugger;
- DILoad;
- RemovePatch;
- end;
- 20: begin { Package 3 Not Present }
- InstallPatch ( 3 );
- SFGetFile(where,'',NIL,1,aTypeList,NIL,reply);
- RemovePatch;
- end;
- 21: begin { Package 4 Not Present }
- InstallPatch ( 4 );
- x:=x*y;
- RemovePatch;
- end;
- 22: begin { Package 5 Not Present }
- InstallPatch ( 5 );
- x:=sin(y);
- RemovePatch;
- end;
- 23: begin { Package 6 Not Present }
- InstallPatch ( 6 );
- If IUMetric then;
- RemovePatch;
- end;
- 24: begin { Package 7 Not Present }
- InstallPatch ( 7 );
- StringToNum ( '123', l );
- RemovePatch;
- end;
- 25: begin { Memory Full Error }
- while ( TRUE ) do begin
- Debugger;
- m := Size ( 2000 );
- l := MaxMem ( m );
- if ( m <= 0 ) then
- m := 100;
- h := NewHandle ( l );
- end;
- end;
- 26: ; { Can't Launch File }
- 27: ; { File System Map has been trashed }
- 28: StkOverFlow; { stack has moved into the application heap }
- 29: ; { !! Not in Errors.h !! }
- 30: MySysError ( 30 ); { request user to insert off-line volume }
- 31: MySysError ( 31 ); { Not the disk I wanted }
- 32: ; { !! Not in Errors.h !! }
- 33: begin { ZcbFree has gone negative }
- h := NewHandle ( 10 );
- tz := GetZone;
- tz^.zcbFree := -1;
- DisposHandle ( h );
- end;
- 34: ; { !! Not in Errors.h !! }
- 35: ; { !! Not in Errors.h !! }
- 36: ; { !! Not in Errors.h !! }
- 37: ; { !! Not in Errors.h !! }
- 38: ; { !! Not in Errors.h !! }
- 39: ; { !! Not in Errors.h !! }
- 40: MySysError ( 40 ); { Welcome to Macintosh }
- 41: MySysError ( 41 ); { Can't load the finder }
- 42: MySysError ( 42 ); { ShutDown Alert }
- end;
- end;
-
-